<template>
  <div>
    <div>水果店</div>
    <hr />
    <div>苹果十块钱一斤，八折</div>
    <hr />
    <div>买多少 <input type="text" v-model="num" /></div>
    <button @click="money">结账</button>
    <div>账单：总价 {{ max }} 元，打折 {{ dezhe }} 省 {{ sheng }} 元</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      num: 0,
      max: 0,
      dezhe: 0,
      sheng: 0,
    }
  },
  methods: {
    money() {
      this.max = this.num * 10
      this.dezhe = this.num * 8
      this.sheng = this.num * 2
    },
  },
}
</script>

<style></style>
